////////////////////////////////////////////////////////////////////////////////


*This do-file produces the EWCS summary statistics table found in Appendix G.


////////////////////////////////////////////////////////////////////////////////

cd "$europedata"

use "clean/ewcs_clean.dta", clear
svyset _n [pw=xw]

qui eststo ewcs2005: svy: mean age male uni temp semp parttime jobtenure if insample&year==2005
estat sd
estadd matrix r(sd)

qui eststo ewcs2010: svy: mean age male uni temp semp parttime jobtenure if insample&year==2010
estat sd
estadd matrix r(sd)

qui eststo ewcs2015: svy: mean age male uni temp semp parttime jobtenure if insample&year==2015
estat sd
estadd matrix r(sd)

cd "$tables" 

esttab ewcs2005 ewcs2010 ewcs2015 using "summary_stats_ewcs.tex", replace booktab cells(b(fmt(%9.3g)) sd(fmt(%9.3g) par(( )))) mlabel("2005" "2010" "2015") nonumbers coeflabels(age "Age" uni "Tertiary degree" semp "Self-employed" parttime "Part-time worker" temp "Temporary worker" jobtenure "Job tenure" male "Male") title("EWCS descriptive statistics (by year)") order(age male uni parttime temp semp jobtenure) collabels("" "" "")
